//封装本地存储存储数据与读取数据方法
//存储数据
export const setToken = (token: string) => {
  sessionStorage.setItem('token', token)
}
//本地存储获取数据
export const getToken = () => {
  return sessionStorage.getItem('token')
}
//本地存储删除数据方法
export const removeToken = () => {
  sessionStorage.removeItem('token')
}

export const setBaseUserInfo = (userBaseInfo: {}) => {
  sessionStorage.setItem('userBaseInfo', JSON.stringify(userBaseInfo))
}

export const getBaseUserInfo = () => {
  return JSON.parse(sessionStorage.getItem('userBaseInfo') || '{}')
}

export const removeBaseUserInfo = () => {
  sessionStorage.removeItem('userBaseInfo')
}

export const setMenuList = (menuList: []) => {
    localStorage.setItem('menuList', JSON.stringify(menuList))
}

export const getMenuList = () => {
  return JSON.parse(localStorage.getItem('menuList') || '[]');
}

export const removeMenuList = () => {
  localStorage.removeItem('menuList')
}
